/**
 * 请求响应数据基础格式
 */
interface IResult<T = any> {
  flag: boolean,
  code: number,
  message: string,
  data: T
}

/**
 * status-menu.vue 标签项类型
 */
type tagMenuType = { tagName: string, status?: number }


/**
 * 评论查询接口
 */
type commentQueryType = {
  current: number,
  isReview?: number | string,
  keyword?: string,
  type?: number | string,
  size: number
}

interface ILinksParams {
  current?: number,
  keyword?: string,
  size?: number
}

interface ILinksBody {
  id?: number | '';
  /**
   * 链接地址
   */
  linkAddress: string;
  /**
   * 链接头像
   */
  linkAvatar: string;
  /**
   * 链接介绍
   */
  linkIntro: string;
  /**
   * 链接名
   */
  linkName: string;
}

interface IErrorLogParams {
  current: number,
  size: number,
  keyword: string
}

interface IUsersOnlineParams {
  current: number,
  size: number,
  keyword: string
}

interface IDashBoardTop {
  articleCount?:   number;
  userCount?:      number;
  viewCount?:      number;
  weekVisitCount?: WeekVisitCount[];
}
interface WeekVisitCount {
  createTime: string;
  viewsCount: number;
}

interface IDashBoardCenter {
  categories:    Category[];
  contributions: Contribution[];
  ranks:         Rank[];
}

interface Category {
  articleCount?: number;
  categoryName?: string;
  createTime?:   string;
  id?:           number;
  updateTime?:   null;
  userId?:       number;
}

interface Contribution {
  count:      number;
  createTime: string;
}

interface Rank {
  count: number;
  title: string;
}

interface IDashBoardBottom {
  areas: any;
  hotTagNames: string[];
}

export type {
  IResult,
  tagMenuType,
  commentQueryType,
  ILinksParams,
  ILinksBody,
  IErrorLogParams,
  IUsersOnlineParams,
  IDashBoardCenter,
  IDashBoardTop,
  IDashBoardBottom
}
